package com.mywork.activity;

import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ciko.code.base.BaseActicity;
import com.ciko.code.bean.SelPolicyListEty;
import com.mywork.R;

/**
 * Created by 12154 on 2015/11/5.
 */
public class WorkOrderDetailActivity extends BaseActicity {

    private SelPolicyListEty selPolicyListEty;
    private TextView tvnameUser;
    private TextView tvnumBaodan;
    private TextView tvmoneyBaodan;
    private TextView tvqudaoBaodan;
    private TextView tvcarCodeBaodan;
    private TextView tvxianzhiBaodan;
    private TextView tvcarTypeBaodan;
    private TextView tvtimeTypeBaodan;
    private TextView tvpriceBaodan;
    private TextView tvstateBaodan;
    private LinearLayout tvbeizhuBaodan;
    private TextView tvnameBaodan;
    private TextView tvaddressBaodan;
    private TextView tvphoneBaodan;
    private View rect_editUsrInfo;

    @Override
    protected void initTopBar() {

        selPolicyListEty = (SelPolicyListEty) getIntent().getSerializableExtra("SelPolicyListEty");

        setTitle("保单详情");
        enableNavLeftImg();
    }

    @Override
    protected void initLayout() {
        setContentView(R.layout.activity_work_order_company_detail);
    }

    @Override
    protected void initView() {
        this.tvphoneBaodan = (TextView) findViewById(R.id.tv_phoneBaodan);
        this.tvaddressBaodan = (TextView) findViewById(R.id.tv_addressBaodan);
        this.tvnameBaodan = (TextView) findViewById(R.id.tv_nameBaodan);
        this.tvbeizhuBaodan = (LinearLayout) findViewById(R.id.tv_beizhuBaodan);
        this.tvstateBaodan = (TextView) findViewById(R.id.tv_stateBaodan);
        this.tvpriceBaodan = (TextView) findViewById(R.id.tv_priceBaodan);
        this.tvtimeTypeBaodan = (TextView) findViewById(R.id.tv_timeTypeBaodan);
        this.tvcarTypeBaodan = (TextView) findViewById(R.id.tv_carTypeBaodan);
        this.tvxianzhiBaodan = (TextView) findViewById(R.id.tv_xianzhiBaodan);
        this.tvcarCodeBaodan = (TextView) findViewById(R.id.tv_carCodeBaodan);
        this.tvqudaoBaodan = (TextView) findViewById(R.id.tv_qudaoBaodan);
        this.tvmoneyBaodan = (TextView) findViewById(R.id.tv_moneyBaodan);
        this.tvnumBaodan = (TextView) findViewById(R.id.tv_numBaodan);
        this.tvnameUser = (TextView) findViewById(R.id.tv_nameUser);
        this.rect_editUsrInfo = findViewById(R.id.rect_editUsrInfo);
    }

    @Override
    protected void initAdapter() {

    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        if (v == rect_editUsrInfo) {
            Intent intent = new Intent(this, WorkManagerEditUserInfoActivity.class);
            intent.putExtra("SelPolicyListEty", selPolicyListEty);
            startActivity(intent);
        }
    }

    @Override
    protected void initDates() {
        tvphoneBaodan.setText(selPolicyListEty.getContactPhone());
        tvaddressBaodan.setText(selPolicyListEty.getAddress());
        tvnameBaodan.setText(selPolicyListEty.getHolderName());
        tvpriceBaodan.setText("" + selPolicyListEty.getPremium());
        tvtimeTypeBaodan.setText(selPolicyListEty.getPolicyEndTime());
        tvcarTypeBaodan.setText(selPolicyListEty.getCarModels());
        tvxianzhiBaodan.setText(selPolicyListEty.getUseProperties());
        tvcarCodeBaodan.setText(selPolicyListEty.getCarCode());
        tvqudaoBaodan.setText(selPolicyListEty.getIndustryType());
        tvmoneyBaodan.setText("" + selPolicyListEty.getPremium());
        tvnumBaodan.setText(selPolicyListEty.getPolicyNumber());
        tvnameUser.setText(selPolicyListEty.getHolderName());
    }

    @Override
    protected void initListener() {
        rect_editUsrInfo.setOnClickListener(this);
    }
}
